const express = require('express')
const app = express()
// const history = require('connect-history-api-fallback')

app.use(require('cors')())
app.use(express.json())
app.use('/uploads', express.static(__dirname + '/uploads'))
app.use('/admin', express.static(__dirname + '/admin'))
app.use('/', express.static(__dirname + '/web'))
// app.use(history())
require('./plugins/db.js')(app)
require('./routes/admin')(app)
require('./routes/web')(app)

app.listen(5000, () => {
  console.log('port 5000 is listening')
})
